<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>JavaScript 字符串方法 </title>
</head>
<body>
<h2>查找字符串中的字符串</h2>

<p>indexOf() 方法返回指定文本首次出现的位置：</p>

<p id="demo"></p>

<script>
  var str = "The full name of China is the People's Republic of China.";
  var pos = str.indexOf("China");
  document.getElementById("demo").innerHTML = pos;
</script>
</body>
</html>

<!--JavaScript 从零计算-->